import { defineStore } from "pinia";
export const useglobalStore = defineStore("globalStore", {
  state: () => {
    return {
      loading: false,
      business:'', //所属商户
      storeId:[], // 门店id
      merchantId:[], // 商户id
      bandId:[] // 品牌id
    };
  },
  actions: {
    getLoading() {
      return this.loading;
    },
    setLoading(state) {
      this.loading = state;
    },
    // 设置名字
    setBusiness(state){
      this.business = state
    },
    setStoreId(id){
      this.storeId = [id]
    },
    setMerchantId(id){
      this.merchantId = [id]
    },
    setBandId(id){
      this.bandId = [id]
    },
    setAllClear(){
      this.business = '' 
      this.storeId = []
      this.merchantId = []
      this.bandId = []
    }
  },
});
